LinuxQMISDK-Lite  SLQS04.00.27
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Functions
QmiSyncObject.h File Reference

Go to the source code of this file.

Data Structures

struct  QmiSyncObject
 

Macros

#define MAX_QMI_PACKET_SIZE   (2048 - 6)
 

Typedefs

typedef struct QmiSyncObject QmiSyncObject
 

Functions

int QmiSyncObject_Initialize (QmiSyncObject *pThis)
 
int QmiSyncObject_Destroy (QmiSyncObject *pThis)
 
int QmiSyncObject_Lock (QmiSyncObject *pThis)
 
int QmiSyncObject_Unlock (QmiSyncObject *pThis)
 
int QmiSyncObject_Wait (QmiSyncObject *pThis)
 
int QmiSyncObject_TimedWait (QmiSyncObject *pThis, time_t timeoutSeconds)
 
int QmiSyncObject_Signal (QmiSyncObject *pThis)
 
void QmiSyncObject_ResponseCallback (uint8_t *qmiPacket, uint16_t qmiPacketSize, void *pResponseCallbackContext)
 

Macro Definition Documentation

#define MAX_QMI_PACKET_SIZE   (2048 - 6)

Maximum size in bytes of a QMI packet. This does not include QMUX header. It becomes the maximum SDU of a QMUX packet, MAX_QMUX_PACKET_SIZE - sizeof(QMUX_HDR)

Typedef Documentation

typedef struct QmiSyncObject QmiSyncObject

This structure is a wrapper around a mutex and condition object and a buffer. It is a convenience object which may be used to create synchronous QMI APIs.

Parameters
mutex
  • For thread safety.
condition
  • Triggered on completion.
buffer
  • QMI request packet is written to this buffer. On request completion, contains the QMI response packet.
bufferSize
  • Set to size in bytes of QMI request packet. On request completion, set to size of QMI response packet.
Note
The buffer is intended for QMI packet only i.e. QMI header and QMI payload. This buffer becomes the SDU of a QMUX packet.

Function Documentation

int QmiSyncObject_Destroy ( QmiSyncObject pThis)

Destroy sync object.

Parameters
[in]pThisThe primary object of this call.
Returns
0 on success, < 0 on failure.
int QmiSyncObject_Initialize ( QmiSyncObject pThis)

Initialize sync object.

Parameters
[in]pThisThe primary object of this call.
Returns
0 on success, < 0 on failure.
int QmiSyncObject_Lock ( QmiSyncObject pThis)

Lock sync object.

Parameters
[in]pThisThe primary object of this call.
Returns
0 on success, < 0 on failure.
void QmiSyncObject_ResponseCallback ( uint8_t *  qmiPacket,
uint16_t  qmiPacketSize,
void *  pResponseCallbackContext 
)

This funcion copies QMI response packet to buffer and signals the waiting thread.

Parameters
[in]qmiPacketReceived QMI packet.
[in]qmiPacketSizeReceived QMI packet size in bytes.
[in]pResponseCallbackContextPointer to this sync object.
int QmiSyncObject_Signal ( QmiSyncObject pThis)

Signal sync object. Waiting thread should wake up.

Parameters
[in]pThisThe primary object of this call.
Returns
0 on success, ETIMEDOUT on timeout, or other negative on failure.
int QmiSyncObject_TimedWait ( QmiSyncObject pThis,
time_t  timeoutSeconds 
)

Block, waiting on sync object for a number of seconds.

Parameters
[in]pThisThe primary object of this call.
[in]timeoutSecondsTimeout in seconds before abondoning wait.
Returns
0 on success, < 0 on failure.
int QmiSyncObject_Unlock ( QmiSyncObject pThis)

Unlock sync object.

Parameters
[in]pThisThe primary object of this call.
Returns
0 on success, < 0 on failure.
int QmiSyncObject_Wait ( QmiSyncObject pThis)

Block, waiting on sync object.

Parameters
[in]pThisThe primary object of this call.
Returns
0 on success, < 0 on failure.

Copyright (c) 2011-2015 Sierra Wireless, Inc. All rights reserved